#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Changelog
# 0.2 : Initial release of database population

from google.appengine.ext import db
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app


class Line(db.Model):
    code = db.StringProperty()
    color = db.StringProperty()
    tz = db.StringProperty()
    network = db.StringProperty()
    line = db.StringProperty()
    stop = db.StringProperty()
    direction = db.StringProperty()
    week = db.StringListProperty()
    staurday = db.StringListProperty()
    sunday = db.StringListProperty()
    summer = db.StringListProperty()


def galt14udes():
    # Ligne 14 - Galt
    h = Line()
    h.code = "galt14udes"
    h.color = "BD0C8E"
    h.tz = "America/Montreal"
    h.network = "Sherbrooke"
    h.line = "14"
    h.stop = u"Galt Ouest - Alexandre"
    h.direction = u"Université de Sherbrooke"
    h.week = ( ["0603","0648","0739","0757","0820","0851","0951","1018","1051"
               ,"1122","1151","1218","1254","1319","1351","1412","1450","1534"
               ,"1603","1627","1700","1724","1757","1836","1856","1944","1959"
               ,"2037","2050","2135","2152","2240","2335","Pas de bus"])
    h.saturday = ( ["0742","0840","0950","1042","1150","1250","1351","1452","1553"
                   ,"1653","1733","1836","1935","2035","2135","2235","2335","Pas de bus"] )
    h.sunday = ( ["1044","1148","1250","1353","1452","1549","1654","1722","1840","1935"
                  "2035","2135","2235","2335","Pas de bus"] )
    h.summer = ( ["0610","0654","0739","0820","0902","0951","1018","1051"
                   ,"1118","1151","1218","1251","1321","1351","1412","1450"
                   ,"1533","1551","1625","1656","1730","1752","1836","1949"
                   ,"2036","2136","2236","2336","Pas de bus"] )

    h.put()
    
def udes14cegep():
    # Ligne 14 - UdeS
    i = Line()
    i.code = u"udes14cegep"
    i.color = "BD0C8E"
    i.tz = u"America/Montreal"
    i.network = u"Sherbrooke"
    i.line = u"14"
    i.stop = u"Université de Sherbrooke"
    i.direction = u"CÉGEP"
    i.week = ( ["0702","0717","0745","0820","0931","0957","1038","1057","1132","1157"
                 ,"1240","1257","1325","1404","1423","1506","1540","1616","1651","1719"
                 ,"1745","1830","1850","1929","1950","2029","2050","2119","2136","2204"
                  ,"2224","2304","Pas de bus"])

    i.saturday = ( ["0707","0842","0949","1039","1139","1239","1330","1430","1536"
                      ,"1637","1743","1830","1929","2029","2129","2205","2304","Pas de bus"] )

    i.sunday = ( ["1005","1039","1139","1239","1330","1430","1536","1637","1743"
                    ,"1830","1929","2029","2129","2205","2304","Pas de bus"] )

    i.summer = ( ["0706","0733","0753","0820","0936","0957","1036","1057","1135","1240"
                    ,"1257","1325","1423","1506","1538","1615","1648","1717","1830","1929"
                    ,"2029","2129","2207","2307","Pas de bus"] )

    i.put()
 
 
def udes8chus():   
    # Ligne 8 - UdeS
    j = Line()
    j.code = u"udes8chus"
    j.color = "39B54A"
    j.tz = u"America/Montreal"
    j.network = u"Sherbrooke"
    j.line = u"8"
    j.stop = u"Université de Sherbrooke"
    j.direction = u"CHUS"
    j.week = ["0643","0707","0731","0826","0840","0907","1003","1106","1125","1205"
                ,"1305","1407","1502","1516","1530","1554","1605","1633","1647","1707"
                ,"1739","1804","1834","1901","1907","2006","2108","2210","2406","Pas de bus"]
    j.saturday = ["0809","1107","1210","1310","1414","1514","1614","1707"
                    ,"1809","1909","2009","2109","2406","Pas de bus"]
    j.sunday = ["1109","1208","1310","1415","1515","1609","1707","1809"
                  ,"1909","2009","2109","Pas de bus"]
    j.summer = ["0645","0712","0908","1008","1108","1208","1308","1413","1512","1610"
                  ,"1641","1708","1809","1909","2009","2109","2212","2406","Pas de bus"]
                  
    j.put()
 
def udes11estrie():       
    # Ligne 11 - UdeS
    k = Line()
    k.code = u"udes11estrie"
    k.color = "EDDB00"
    k.tz = u"America/Montreal"
    k.network = u"Sherbrooke"
    k.line = u"11"
    k.stop = u"Université de Sherbrooke"
    k.direction = u"Carrefour de l'Estrie"
    k.week = ["0729","0812","0814","0819","0848","0917","0948","1013","1030","1045","1115","1131","1144","1211","1224","1242","1314","1324","1340","1410","1426","1441","1513","1529","1547","1617","1649","1716","1747","1820","1843","1843","1909","1938","2043","2103","2127","2142","2215","2236","2336","Pas de bus"]
    
    k.saturday = ["0813","0840","0906","0937","1008","1036","1105","1137","1210","1239","1310","1339","1406","1440","1506","1540","1606","1640","1709","1812","1841","1943","2043","2142","2239","2336","Pas de bus"]
    k.sunday = ["1006","1106","1209","1300","1405","1510","1606","1709","1813","1841","1943","2043","2142","2239","2346","Pas de bus"]
    k.summer = ["0730","0819","0849","0910","0948","1011","1045","1124","1144","1211","1242","1310","1342","1410","1452","1510","1545","1611","1615","1658","1716","1746","1819","1844","1909","1935","2043","2142","2239","2342","Pas de bus"]
    
    k.put()

def estrie11udes():       
    # Ligne 11 - Estrie
    l = Line()
    l.code = u"estrie11udes"
    l.color = "EDDB00"
    l.tz = u"America/Montreal"
    l.network = u"Sherbrooke"
    l.line = u"11"
    l.stop = u"Carrefour de l'Estrie"
    l.direction = u"Université de Sherbrooke"
    l.week = ["0653","0716","0800","0823","0859","0928","0958","1028","1054","1124","1134","1154","1225","1234","1253","1325","1336","1353","1428","1436","1453","1514","1525","1550","1600","1621","1656","1715","1728","1745","1801","1833","1903","1956","2016","2054","2125","2152","2250","2353","Pas de bus"]
    l.saturday = ["0748","0850","0917","0948","1018","1048","1114","1148","1214","1248","1314","1348","1414","1448","1514","1548","1617","1649","1719","1747","1854","1954","2054","2152","2250","Pas de bus"]
    l.sunday = ["1044","1146","1248","1337","1444","1547","1649","1726","1752","1854","1954","2054","2152","2250","Pas de bus"]
    l.summer = ["0653","0722","0804","0829","0905","0948","1028","1102","1125","1201","1225","1253","1325","1353","1438","1453","1523","1550","1624","1656","1728","1801","1833","1854","1903","1954","2054","2128","2152","2252","2353","Pas de bus"]
    l.put()

def galt7andre():       
    # Ligne 7 - Galt Belvedere
    l = Line()
    l.code = u"galt7andre"
    l.color = "ED1C24"
    l.tz = u"America/Montreal"
    l.network = u"Sherbrooke"
    l.line = u"7"
    l.stop = u"Belvédère - Galt"
    l.direction = u"André - Thibault"
    l.week = ["0636","0733","0744","0838","0849","0911","0940","1020","1038","1120","1136","1220","1236","1320","1336","1420","1436","1515","1538","1619","1642","1721","1746","1822","1836","1908","1942","2042","2142","2200","2252","2337","2437","Pas de bus"]
    l.saturday = ["0738","0839","1119","1219","1319","1419","1519","1619","1719","1826","1838","1941","2041","2125","2202","2252","2335","2435","Pas de bus"]
    l.sunday = ["1034","1140","1231","1336","1441","1537","1636","1739","1838","1943","2041","2125","2202","2252","2335","2435","Pas de bus"]
    l.summer = ["0838","0849","0920","0936","1020","1036","1120","1136","1220","1236","1320","1336","1420","1436","1515","1538","1621","1641","1721","1743","1836","1942","2042","2132","2200","2252","2335","2435","Pas de bus"]
    l.put()

def galt19lisieux():       
    # Ligne 19 - Galt Alexandre
    l = Line()
    l.code = u"galt19lisieux"
    l.color = "56CBF5"
    l.tz = u"America/Montreal"
    l.network = u"Sherbrooke"
    l.line = u"19"
    l.stop = u"Galt Ouest - Alexandre"
    l.direction = u"Lissieux - Brûlé"
    l.week = ["0610","0639","0711","0740","0835","0933","1033","1133","1233","1337","1439","1512","1542","1614","1642","1713","1742","1806","1842","Pas de bus"]
    l.saturday = ["Pas de bus"]
    l.sunday = ["Pas de bus"]
    l.summer = ["0603","0637","0712","0750","0825","0933","1034","1133","1234","1337","1443","1546","1612","1642","1714","1811","Pas de bus"]
    l.put()

def belvedere12estrie():       
    # Ligne 12 - king belvedere
    l = Line()
    l.code = u"belvedere12estrie"
    l.color = "007F3D"
    l.tz = u"America/Montreal"
    l.network = u"Sherbrooke"
    l.line = u"12"
    l.stop = u"Belvédère - King"
    l.direction = u"Carrefour de l'Estrie"
    l.week = ["0631","0732","0802","0835","0908","1008","1107","1136","1209","1238","1309","1338","1408","1436","1506","1533","1607","1620","1654","1720","1747","1816","1844","1909","2011","2108","2216","2333","Pas de bus"]
    l.saturday = ["0733","0833","0905","1006","1033","1108","1207","1308","1403","1505","1604","1708","1815","1909","2013","2113","2213","2333","Pas de bus"]
    l.sunday = ["11:04","12:07","13:05","14:05","15:05","16:09","17:09","18:13","19:07","20:13","21:13","22:13","23:33","Pas de bus"]
    l.summer = ["0632","0733","0835","0909","1008","1108","1136","1208","1238","1308","1338","1408","1437","1506","1532","1604","1652","1720","1747","1816","1844","1909","2012","2112","2217","2335","Pas de bus"]
    l.put()
    
def lyonRavon():       
    # Ligne Transilien R - Gare de Lyon
    l = Line()
    l.code = u"lyonRavon"
    l.color = "E1BED9"
    l.tz = u"Europe/Paris"
    l.network = u"Paris Transilien"
    l.line = u"R"
    l.stop = u"Paris Gare de Lyon"
    l.direction = u"Fontainebleau Avon"
    l.week = ["0605","0635","0706","0735","0805","0835","0905","1005","1035","1105","1135","1205","1235","1305","1335","1405","1435","1505","1535","1601","1616","1643","1701","1716","1731","1743","1801","1816","1831","1843","1901","1916","1935","2005","2035","2105","2135","2205","2235","2305","2335","2435","Pas de train"]
    l.saturday = ["0605","0635","0706","0735","0805","0835","0905","1005","1035","1105","1135","1205","1235","1305","1335","1405","1435","1505","1535","1605","1635","1705","1735","1805","1835","1905","1935","2005","2035","2105","2135","2205","2235","2305","2335","2435","Pas de train"]
    l.sunday = ["0605","0635","0706","0735","0805","0835","0905","1005","1035","1105","1135","1205","1235","1305","1335","1405","1435","1505","1535","1605","1635","1705","1735","1805","1835","1905","1935","2005","2035","2105","2135","2205","2235","2305","2335","2435","Pas de train"]
    l.summer = ["0605","0635","0706","0735","0805","0835","0905","1005","1035","1105","1135","1205","1235","1305","1335","1405","1435","1505","1535","1601","1616","1643","1701","1716","1731","1743","1801","1816","1831","1843","1901","1916","1935","2005","2035","2105","2135","2205","2235","2305","2335","2435","Pas de train"]
    l.put()    

def avonRlyon():       
    # Ligne Transilien R - Gare de Fontainebleau Avon
    l = Line()
    l.code = u"avonRlyon"
    l.color = "E1BED9"
    l.tz = u"Europe/Paris"
    l.network = u"Paris Transilien"
    l.line = u"R"
    l.stop = u"Fontainebleau Avon"
    l.direction = u"Paris Gare de Lyon"
    l.week = ["0605","0635","0706","0735","0805","0835","0905","1005","1035","1105","1135","1205","1235","1305","1335","1405","1435","1505","1535","1601","1616","1643","1701","1716","1731","1743","1801","1816","1831","1843","1901","1916","1935","2005","2035","2105","2135","2205","2235","2305","2335","2435","Pas de train"]
    l.saturday = ["0531","0604","0631","0704","0731","0804","0831","0904","0931","1004","1104","1131","1204","1231","1304","1331","1404","1431","1504","1531","1604","1631","1704","1731","1804","1831","1904","1931","2004","2031","2104","2131","2204","2231","2304","2331","2404","Pas de train"]
    l.sunday = ["0531","0604","0631","0704","0731","0804","0831","0904","0931","1004","1104","1131","1204","1231","1304","1331","1404","1431","1504","1531","1604","1631","1704","1731","1804","1831","1904","1931","2004","2031","2104","2131","2204","2231","2304","2331","2404","Pas de train"]
    l.summer = ["0605","0635","0706","0735","0805","0835","0905","1005","1035","1105","1135","1205","1235","1305","1335","1405","1435","1505","1535","1601","1616","1643","1701","1716","1731","1743","1801","1816","1831","1843","1901","1916","1935","2005","2035","2105","2135","2205","2235","2305","2335","2435","Pas de train"]
    l.put()      

def avonAlilas():       
    # Ligne A - Fontainebleau
    l = Line()
    l.code = u"avonAlilas"
    l.color = "98CCFF"
    l.tz = u"Europe/Paris"
    l.network = u"Fontainebleau"
    l.line = u"A"
    l.stop = u"Gare routière de Fontainebleau Avon"
    l.direction = u"Les Lilas (IUT Fontainebleau)"
    l.week = ["0555","0626","0638","0648","0705","0722","0739","0752","0805","0820","0835","0845","0905","0920","0945","1005","1023","1045","1105","1120","1136","1145","1200","1233","1250","1320","1345","1400","1420","1433","1454","1513","1533","1546","1610","1630","1645","1707","1728","1745","1802","1813","1826","1845","1902","1919","1926","1945","2006","2020","2045","2120","2220","Pas de bus"]
    l.saturday = ["0616","0645","0702","0718","0745","0805","0820","0845","0920","0950","1010","1030","1045","1108","1125","1155","1210","1225","1245","1310","1325","1345","1408","1425","1445","1508","1525","1545","608","1625","1645","1725","1753","1830","1845","1920","1945","2020","2045","2126","Pas de bus"]
    l.sunday = ["0645","0719","0747","0821","0845","0924","0955","1030","1045","1125","1155","1220","1245","1320","1345","1430","1455","1525","1550","1620","1645","1720","1745","1820","1845","1920","1950","2022","2120","2220","2320","Pas de bus"]
    l.summer = l.week
    l.put() 

def lilasAavon():       
    # Ligne A - Lilas
    l = Line()
    l.code = u"lilasAavon"
    l.color = "98CCFF"
    l.tz = u"Europe/Paris"
    l.network = u"Fontainebleau"
    l.line = u"A"
    l.direction = u"Gare routière de Fontainebleau Avon"
    l.stop = u"Les Lilas (IUT Fontainebleau)"
    l.week = ["0533","0549","0605","0617","0635","0648","0700","0710","0727","0743","0812","0836","0854","0906","0919","0936","0950","1015","1032","1050","1112","1132","1147","1203","1212","1227","1300","1320","1347","1412","1427","1447","1500","1521","1540","1600","1613","1638","1657","1719","1738","1759","1818","1835","1843","1856","1918","1928","1945","1955","2014","2029","2047","2147","Pas de bus"]
    l.saturday = ["0614","0639","0708","0725","0741","0808","0830","0845","0910","0945","1015","1035","1055","1110","1133","1152","1220","1235","1250","1310","1335","1351","1411","1434","1451","1511","1534","1551","1614","1634","1651","1711","1754","1819","1835","1859","1911","1945","2010","2105","Pas de bus"]
    l.sunday = ["0708","0742","0810","0844","0908","0948","1025","1054","1109","1152","1219","1244","1309","1409","1454","1519","1549","1614","1650","1709","1744","1809","1909","1944","2013","2045","Pas de bus"]
    l.summer = l.week
    l.put()

def mairieAavon():       
    # Ligne A - Lilas
    l = Line()
    l.code = u"mairieAavon"
    l.color = "98CCFF"
    l.tz = u"Europe/Paris"
    l.network = u"Fontainebleau"
    l.line = u"A"
    l.direction = u"Gare routière de Fontainebleau Avon"
    l.stop = u"Mairie de Fontainebleau"
    l.week = ["0537","0553","0609","0621","0639","0652","0704","0714","0731","0747","0747","0816","0840","0858","0910","0923","0940","0954","1019","1036","1054","1116","1136","1151","1207","1216","1231","1304","1324","1351","1416","1431","1451","1504","1525","1544","1604","1617","1642","1702","1724","1743","1803","1822","1839","1847","1900","1922","1932","1949","1959","2018","2033","2051","2151","Pas de bus"]
    l.saturday = ["0617","0642","0712","0729","0745","0812","0834","0849","0914","0949","1019","1039","1059","1114","1137","1156","1224","1239","1254","1314","1339","1355","1415","1438","1455","1515","1538","1555","1618","1638","1655","1715","1758","1823","1839","1902","1914","1948","2013","2108","Pas de bus"]
    l.sunday = ["0711","0745","0813","0847","0912","0952","1029","1058","1113","1156","1223","1248","1313","1413","1458","1524","1553","1618","1654","1713","1748","1813","1913","1948","2017","2049","Pas de bus"]
    l.summer = l.week
    l.put()
    
def stlazareLcourbevoie():       
    # Ligne Transilien L - Paris St Lazare
    l = Line()
    l.code = u"stlazareLcourbevoie"
    l.color = "6E7DCE"
    l.tz = u"Europe/Paris"
    l.network = u"Paris Transilien"
    l.line = u"L"
    l.stop = u"Paris Saint-Lazare"
    l.direction = u"Courbevoie"
    l.week = ["0013","0025","0043","0055","0542","0552","0600","0622","0637","0652","0705","0720","0735","0750","0805","0820","0835","0850","0906","0921","0936","0951","1006","1021","1036","1051","1106","1121","1136","1151","1206","1221","1236","1251","1306","1321","1336","1351","1406","1421","1436","1451","1506","1521","1536","1550","1605","1620","1635","1650","1705","1720","1736","1743","1751","1758","1806","1813","1821","1828","1835","1850","1905","1920","1935","1950","2005","2020","2035","2050","2113","2125","2143","2155","2213","2225","2243","2255","2313","2325","2343","2355","2413","2425","2443","2455","Pas de train"]
    l.saturday = ["0013","0025","0043","0055","0542","0552","0600","0622","0637","0652","0705","0720","0735","0750","0805","0820","0835","0850","0906","0921","0936","0951","1006","1021","1036","1051","1106","1121","1136","1151","1206","1221","1236","1251","1306","1321","1336","1351","1406","1421","1436","1451","1506","1521","1536","1550","1605","1620","1635","1650","1705","1720","1736","1743","1751","1758","1806","1813","1821","1828","1835","1850","1905","1920","1935","1950","2005","2020","2035","2050","2113","2125","2143","2155","2213","2225","2243","2255","2313","2325","2343","2355","2413","2425","2443","2455","Pas de train"]
    l.sunday = l.saturday
    l.summer = l.week
    l.put()      

def courbevoieLdefense():       
    # Ligne Transilien L - Courbevoie
    l = Line()
    l.code = u"courbevoieLdefense"
    l.color = "6E7DCE"
    l.tz = u"Europe/Paris"
    l.network = u"Paris Transilien"
    l.line = u"L"
    l.direction = u"La Défense"
    l.stop = u"Courbevoie"
    l.week = ["0004","0022","0034","0052","0107","0552","0602","0609","0631","0646","0701","0715","0730","0745","0800","0815","0830","0845","0900","0915","0930","0945","1000","1015","1030","1045","1100","1115","1130","1145","1200","1215","1230","1245","1300","1315","1330","1345","1400","1415","1430","1445","1500","1515","1530","1545","1600","1615","1630","1645","1700","1715","1730","1745","1752","1800","1807","1815","1822","1830","1837","1845","1900","1915","1930","1945","2000","2015","2030","2045","2100","2122","2134","2152","2204","2222","2234","2252","2304","2322","2334","2352","2404","2422","2434","2452","Pas de train"]
    l.saturday = ["0004","0022","0034","0052","0107","0602","0609","0631","0642","0646","0701","0715","0730","0745","0800","0815","0830","0845","0900","0915","0930","0945","1000","1015","1030","1045","1100","1115","1130","1145","1200","1215","1230","1245","1300","1315","1330","1345","1400","1415","1430","1445","1500","1515","1530","1545","1600","1615","1630","1645","1700","1715","1730","1745","1800","1815","1830","1845","1900","1915","1930","1945","2000","2015","2030","2045","2104","2122","2134","2152","2204","2222","2234","2252","2304","2322","2334","2352","2404","2422","2434","2452","Pas de train"]
    l.sunday = l.saturday
    l.summer = l.week
    l.put()  

def beconLdefense():       
    # Ligne Transilien L - Bécon les Bruyères
    l = Line()
    l.code = u"beconLdefense"
    l.color = "6E7DCE"
    l.tz = u"Europe/Paris"
    l.network = u"Paris Transilien"
    l.line = u"L"
    l.direction = u"La Défense"
    l.stop = u"Bécon les Bruyères"
    l.week = ["0001","0019","0031","0049","0104","0549","0559","0606","0629","0644","0659","0713","0728","0743","0758","0813","0828","0843","0858","0912","0927","0942","0957","1012","1027","1042","1057","1112","1127","1142","1157","1212","1227","1242","1257","1312","1327","1342","1357","1412","1427","1442","1457","1512","1527","1542","1557","1612","1627","1642","1657","1712","1727","1743","1750","1758","1805","1813","1820","1828","1835","1842","1857","1912","1927","1942","1957","2012","2027","2042","2057","2119","2131","2149","2201","2219","2231","2249","2301","2319","2331","2349","2401","2419","2431","2449","Pas de train"]
    l.saturday = ["0001","0019","0031","0049","0104","0559","0606","0629","0639","0644","0659","0713","0728","0743","0758","0813","0828","0843","0858","0912","0927","0942","0957","1012","1027","1042","1057","1112","1127","1142","1157","1212","1227","1242","1257","1312","1327","1342","1357","1412","1427","1442","1457","1512","1527","1542","1557","1612","1627","1642","1657","1712","1727","1742","1757","1812","1827","1842","1857","1912","1927","1942","1957","2012","2027","2042","2101","2119","2131","2149","2201","2219","2231","2249","2301","2319","2331","2349","2401","2419","2431","2449","Pas de train"]
    l.sunday = l.saturday
    l.summer = l.week
    l.put()  


def clarkBeaubien55sud():
    # Ligne 55 Sud - Clark/Beaubien 
    l = Line()
    l.code = u"ClarkBeaubien55sud"
    l.color = "003E9B"
    l.tz = u"America/Montreal"
    l.network = u"Montréal"
    l.line = u"55"
    l.direction = u"Sud"
    l.stop = u"Clark / Beaubien"
    l.week = ["0014","0041","0522","0557","0627","0650","0703","0715","0726","0736","0746","0756","0806","0816","0826","0836","0846","0858","0910","0922","0933","0945","0957","1009","1021","1033","1045","1057","1110","1124","1137","1152","1207","1222","1237","1252","1307","1322","1337","1352","1407","1422","1437","1452","1505","1515","1525","1534","1543","1552","1601","1611","1621","1632","1646","1701","1716","1730","1744","1759","1814","1831","1849","1907","1926","1947","2017","2047","2117","2147","2216","2246","2316","2345","2414","2441","Pas de bus"]
    l.saturday = ["0014","0041","0522","0557","0627","0657","0728","0758","0826","","0848","0910","0933","0957","","1019","1039","1053","1107","1122","1136","1149","","1202","","1214","1226","","1239","1252","1305","1317","1330","1343","","1355","1407","1419","","1430","1441","1452","1503","","1516","1529","","1542","1555","1609","","1622","1636","1649","","1703","1718","1738","1756","1816","1836","1857","1918","1939","2000","2020","2040","2059","2119","2144","2214","2244","2313","2342","2412","2441","0111","Pas de bus"]
    l.sunday = ["0012","0041","0111","0519","0551","0624","0657","0727","0758","0830","0900","0930","0954","1015","1036","1056","1114","1130","1146","1202","1217","1232","1246","1259","1311","1324","1337","1349","","1402","1414","1426","1437","1449","1502","1515","1529","","1544","1559","","1615","1635","1655","1715","1735","1755","1814","1844","1914","1944","2013","2044","2114","2145","2215","2245","2315","2345","2414","2441","Pas de bus"]
    l.summer = l.week
    l.put()  

def clarkBeaubien363sud():
    # Ligne 363 Sud - Clark/Beaubien 
    l = Line()
    l.code = u"ClarkBeaubien363sud"
    l.color = "244E8E"
    l.tz = u"America/Montreal"
    l.network = u"Montréal"
    l.line = u"363"
    l.direction = u"Sud - Service de nuit"
    l.stop = u"Clark / Beaubien"
    l.week = ["0115","0202","0249","0336","0417","0500","Pas de bus"]
    l.saturday = ["0201","0245","0329","0414","0459","Pas de bus"]
    l.sunday = ["0115","0205","0250","0336","0415","0500","Pas de bus"]
    l.summer = l.week
    l.put()  


def peixottoBclaveau():       
    # Ligne B Bordeaux  - Peixoto
    l = Line()
    l.code = u"peixottoBclaveau"
    l.color = "E80000"
    l.tz = u"Europe/Paris"
    l.network = u"Bordeaux CUB"
    l.line = u"B"
    l.direction = u"Claveau"
    l.stop = u"Peixotto"
    l.week = ["","Pas de tram"]
    l.saturday = ["","Pas de tram"]
    l.sunday = l.saturday
    l.summer = l.week
    l.put()  

def alls():
    belvedere12estrie()
    galt19lisieux()
    estrie11udes()
    udes11estrie()
    udes8chus()
    udes14cegep()
    galt14udes()
    galt7andre()
    avonRlyon()
    lyonRavon()
    avonAlilas()  
    lilasAavon()
    mairieAavon() 
    stlazareLcourbevoie()
    courbevoieLdefense()
    beconLdefense()    
    clarkBeaubien363sud()
    clarkBeaubien55sud()
    
def newadd():
    clarkBeaubien363sud()
    clarkBeaubien55sud()

class MainPage(webapp.RequestHandler):
    def get(self):
        user = users.get_current_user()
        if user:
            if users.is_current_user_admin():
                alls()
                self.response.headers['Content-Type'] = 'text/plain'
                self.response.out.write(u"Enregistrement terminé")
            else:
                self.response.headers['Content-Type'] = 'text/plain'
                self.response.out.write(u"Vous n'êtes pas admin...")
        else:
            self.redirect(users.create_login_url(self.request.uri))

application = webapp.WSGIApplication(
                                     [('/database', MainPage)],
                                     debug=True)

def main():
    run_wsgi_app(application)

if __name__ == "__main__":
    main()
